/**
 * Copyright(c)2012 Beijing PeaceMap Co.,Ltd.
 * All right reserved. 
 */
package com.pmc.dwa.security.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.pmc.dwa.common.utils.PaginationSupport;
import com.pmc.dwa.security.model.TRole;
import com.pmc.dwa.security.model.TSect;
import com.pmc.dwa.security.model.TSection;
import com.pmc.dwa.security.model.TUser;
import com.pmc.dwa.security.model.TUserDetails;

/**
 * @description 用户操作
 * @author aokunsang
 * @date 2013-1-6
 */
public interface IUserService {
	
	/**
	 * 添加日志信息
	 * @param request HttpServletRequest对象
	 * @param model Action类名
	 * @param event Action方法名
	 * @param remark 备注信息
	 */
	public void addSyslog(HttpServletRequest request, String model, String event, String remark);
	/*------------------------获取权限信息所需--------------------------*/
	/* 通过用户名查找详细用户信息 */
	public TUserDetails findUserDetailsByUserName(String username);
	/* 通过用户名查询对应角色列表*/
	public List<TRole> findUserRolesByUsername(String username);
	/* 查询所有角色信息 */
	public List<TRole> findAllRoles();
	/* 根据角色名查询对应资源列表*/
	public List<TSect> findSectByRolename(String rolename);
	/* 获取有效的分区*/
	public TSection findValidSection(TSection section);
	/*------------------------修改密码等业务操作[主要做些首页上业务]--------------------*/
	public void editUserState(String username,String ipAddr);
	public void editLoginUserPwd(String userid,String newPwd);
	public void editUserPartinfo(TUser user);
	
	/*-----------------------用户管理-------------------------------*/
	public PaginationSupport<TUser> getPagesTUser(String sectionid,String queryname,int pageNumber,int pageSize);
	public TUser findUserByName(String username);
	public TUser findUserByid(String userid);
	public TSection findSectionByUid(String uid);
	public boolean chkDataByCol(String colName, String colVal);
	public void editUserColumnVal(String uid, String columnName, String columnVal);
	public void editUser(TUser user,String[] sectionid,String[] roleid);
	public void addUser(TUser user,String[] sectionid,String[] roleid);
	public void delUser(String uid);
}